home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-01 | 4.7 KB | 193 lines | [TEXT/MPS ] |
- {
- File: SystemLogging.p
-
- Contains: System Logging Service
-
- Version: Technology: 1.0
- Release: Universal Interfaces 3.0d3 on Copland DR1
-
- Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- }
- {$IFC UNDEFINED UsingIncludes}
- {$SETC UsingIncludes := 0}
- {$ENDC}
-
- {$IFC NOT UsingIncludes}
- UNIT SystemLogging;
- INTERFACE
- {$ENDC}
-
- {$IFC UNDEFINED __SYSTEMLOGGING__}
- {$SETC __SYSTEMLOGGING__ := 1}
-
- {$I+}
- {$SETC SystemLoggingIncludes := UsingIncludes}
- {$SETC UsingIncludes := 1}
-
- {$IFC UNDEFINED __TYPES__}
- {$I Types.p}
- {$ENDC}
- {$IFC UNDEFINED __TEXTOBJECTS__}
- {$I TextObjects.p}
- {$ENDC}
- {$IFC UNDEFINED __TIMEOBJECTS__}
- {$I TimeObjects.p}
- {$ENDC}
- {$IFC UNDEFINED __AEDATAMODEL__}
- {$I AEDataModel.p}
- {$ENDC}
-
- {$PUSH}
- {$ALIGN MAC68K}
- {$LibExport+}
-
- {$IFC FOR_SYSTEM8_PREEMPTIVE }
- {$IFC FOR_PTR_BASED_AE }
- { Service types }
-
- TYPE
- LogID = UInt32;
- LogIterator = UInt32;
- { Situation Types }
- LogSituationType = UInt32;
-
- CONST
- kLogTypeInformation = 'info';
- kLogTypeWarning = 'warn';
- kLogTypeFatal = 'fatl';
- kLogTypeSystemFatal = 'sysf';
- kLogTypeAll = '****';
-
- { System Logging Areas }
-
- TYPE
- LogArea = UInt32;
-
- CONST
- kLogAreaIO = 'io ';
- kLogAreaNetworking = 'netw';
- kLogAreaKernel = 'kern';
- kLogAreaApplication = 'appl';
- kLogAreaBoot = 'boot';
- kLogAreaPrinting = 'prnt';
- kLogAreaCommunication = 'comm';
- kLogAreaServer = 'serv';
- kLogAreaAll = '****';
-
- { Service Version }
-
- TYPE
- LogVersion = UInt32;
-
- CONST
- kLogVersion1 = 1;
- kLogCurrentVersion = 1;
-
- { Log Message Versions }
-
- TYPE
- LogMsgVersion = UInt32;
-
- CONST
- kLogMsgVersion1 = 1;
- kLogCurrentMsgVersion = 1;
-
- { Message Flags }
-
- TYPE
- LogMsgFlags = UInt32;
-
- CONST
- kLogMsgFlagsDataTruncated = $00000001;
- kLogMsgFlagsReceivedCorrupted = $00000002;
- kLogMsgFlagsTimeInUptime = $00000004;
- kLogMsgFlagsNotified = $00000008;
-
-
- TYPE
- LogMessagePtr = ^LogMessage;
- LogMessage = RECORD
- msgSize: ByteCount;
- msgVersion: LogMsgVersion;
- msgFlags: LogMsgFlags;
- msgSituationType: LogSituationType;
- msgRepeatedCount: UInt32;
- msgArea: LogArea;
- msgClient: OSType;
- msgTimestamp: TimeObject;
- msgDataCount: ByteCount;
- msgStatus: OSStatus;
- msgTextSize: ByteCount;
- END;
-
-
- CONST
- kLogMaxMessageSize = 1024;
-
-
- TYPE
- LogStatisticsVersion = UInt32;
-
- CONST
- kLogStatisticsVersion1 = 1;
- kLogStatisticsCurrentVersion = 1;
-
- { System Logging Statistics }
-
- TYPE
- LogStatisticsPtr = ^LogStatistics;
- LogStatistics = RECORD
- statsVersion: LogStatisticsVersion;
- situationMsgsDropped: UInt32;
- situationMsgsTruncated: UInt32;
- situationMsgsLoggedThisSession: UInt32;
- situationMsgsCurrentlyInTheLog: UInt32;
- situationMsgsNotified: UInt32;
- pluginsInstalled: UInt32;
- END;
-
- { Variables and constants for use in the System Notication Service }
-
- CONST
- kSystemLoggingService = 'slss';
- kLogSNSMsgKind = 'slsm';
- kLogSNSMsgSubjectSize = 12;
-
- { Basic Logging routine }
- FUNCTION LogSituation(situationType: LogSituationType; situationArea: LogArea; situationClient: OSType; situationText: TextObject; situationStatus: OSStatus; situationData: AEStream): OSStatus; C;
- { System Logging Service Administration APIs }
- FUNCTION LogOpen(VAR theService: LogID; clientName: TextObject): OSStatus; C;
- FUNCTION LogClose(theService: LogID): OSStatus; C;
- FUNCTION LogGetClientName(clientName: TextObject): OSStatus; C;
- FUNCTION LogClear(theService: LogID): OSStatus; C;
- FUNCTION LogFlush(theService: LogID): OSStatus; C;
- FUNCTION LogGetCommAreaSize(theService: LogID; VAR size: ByteCount): OSStatus; C;
- FUNCTION LogSetCommAreaSize(theService: LogID; size: ByteCount): OSStatus; C;
- FUNCTION LogCreateIterator(theService: LogID; VAR iterator: LogIterator): OSStatus; C;
- FUNCTION LogGetEntry(iterator: LogIterator; version: LogMsgVersion; VAR msg: LogMessage): OSStatus; C;
- FUNCTION LogDisposeIterator(iterator: LogIterator): OSStatus; C;
- FUNCTION LogExtractText(VAR entry: LogMessage; text: TextObject): OSStatus; C;
- FUNCTION LogExtractAEDesc(VAR entry: LogMessage; VAR desc: AEDesc): OSStatus; C;
- FUNCTION LogGetStatistics(theService: LogID; version: LogStatisticsVersion; VAR statistics: LogStatistics): OSStatus; C;
- FUNCTION LogGetLogSize(theService: LogID; VAR maxSize: ByteCount): OSStatus; C;
- FUNCTION LogSetLogSize(theService: LogID; maxSize: ByteCount): OSStatus; C;
- {$ENDC}
- {$ENDC}
- {$ALIGN RESET}
- {$POP}
-
- {$SETC UsingIncludes := SystemLoggingIncludes}
-
- {$ENDC} {__SYSTEMLOGGING__}
-
- {$IFC NOT UsingIncludes}
- END.
- {$ENDC}
-